<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title></title>
    <style>
        /* 三点加载动画样式 */
        .container {
            width: 100px;
            height: 100px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            animation: rotate-move 2s ease-in-out infinite;
            display: none;
        }
        .dot {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
        }
        .dot-3 { background-color: #f74d75; animation: dot-3-move 2s ease infinite; }
        .dot-2 { background-color: #10beae; animation: dot-2-move 2s ease infinite; }
        .dot-1 { background-color: #ffe386; animation: dot-1-move 2s ease infinite; }

        @keyframes dot-3-move {
            20%,100% { transform: scale(1) }
            45%,80% { transform: translateY(-18px) scale(.45) }
        }
        @keyframes dot-2-move {
            20%,100% { transform: scale(1) }
            45%,80% { transform: translate(-16px, 12px) scale(.45) }
        }
        @keyframes dot-1-move {
            20%,100% { transform: scale(1) }
            45%,80% { transform: translate(16px, 12px) scale(.45) }
        }
        @keyframes rotate-move {
            55% { transform: translate(-50%, -50%) rotate(0deg) }
            80%,100% { transform: translate(-50%, -50%) rotate(360deg) }
        }

        /* 全局水印样式 */
        .watermark {
            position: fixed;
            pointer-events: none;
            width: 100%;
            height: 100%;
            background-image: repeating-linear-gradient(
                    -45deg,
                    rgba(255, 0, 0, 0.1),
                    rgba(255, 0, 0, 0.1) 20px,
                    rgba(0, 0, 255, 0.1) 20px,
                    rgba(0, 0, 255, 0.1) 40px
            );
            z-index: 9999;
            display: none;
        }
        .watermark-text {
            position: absolute;
            color: rgba(255, 0, 0, 0.6);
            font-size: 18px;
            font-weight: bold;
            text-align: center;
            width: 100%;
            top: 50%;
            transform: translateY(-50%);
            text-shadow: 1px 1px 1px #fff;
        }

        /* iframe样式 */
        .content {
            height: 100%;
            width: 100%;
            position: fixed;
            inset: -2px;
            z-index: 1;
        }
    </style>
</head>

<body>
<!-- 三点加载动画容器 -->
<div class="container" id="loadingContainer">
    <div class="dot dot-1"></div>
    <div class="dot dot-2"></div>
    <div class="dot dot-3"></div>
</div>

<!-- 全局水印 -->
<div class="watermark" id="watermark">
</div>

<script>
    (function() {
        // 白名单域名配置（预留位置方便后期添加）
        const WHITELIST_CONFIG = {
            domains: [
                '*',
            ],
            // 预留其他配置项
            watermarkText: '提示：请联系Tg：@angleamerkel授权'
        };

        // 显示三点加载动画
        function showLoadingAnimation() {
            document.getElementById('loadingContainer').style.display = 'block';
        }

        // 验证URL域名是否在白名单
        function isAllowedDomain(url) {
            return true
            try {
                const domain = new URL(url).hostname.replace('www.', '');
                return WHITELIST_CONFIG.domains.some(allowedDomain => {
                    return domain === allowedDomain ||
                        domain.endsWith('.' + allowedDomain);
                });
            } catch (e) {
                console.error('URL解析失败:', e);
                return false;
            }
        }

        // 主处理逻辑
        function processRedirect() {
            showLoadingAnimation();

            const urlParams = new URLSearchParams(window.location.search);
            const encodedParam = urlParams.get('c');

            if (!encodedParam) {
                document.getElementById('watermark').style.display = 'block';
                document.getElementById('loadingContainer').style.display = 'none';
                return;
            }

            try {
                const trueUrl = atob(encodedParam);
                if (trueUrl.includes("http")) {
                    // 检查域名是否在白名单
                    if (!isAllowedDomain(trueUrl)) {
                        document.getElementById('watermark').style.display = 'block';
                        document.querySelector('.watermark-text').textContent = WHITELIST_CONFIG.watermarkText;
                    }

                    // 创建并加载iframe
                    const iframe = document.createElement('iframe');
                    iframe.className = 'content';
                    iframe.src = trueUrl;

                    iframe.addEventListener('load', function() {
                        document.getElementById('loadingContainer').style.display = 'none';
                    });

                    document.body.appendChild(iframe);
                }
            } catch (e) {
                console.error('URL解码失败:', e);
                document.getElementById('watermark').style.display = 'block';
                document.getElementById('loadingContainer').style.display = 'none';
            }
        }

        // 禁止F12开发者工具
        document.addEventListener('keydown', function(e) {
            if (e.key === 'F12' ||
                (e.ctrlKey && e.shiftKey && e.key === 'I') ||
                (e.ctrlKey && e.shiftKey && e.key === 'J') ||
                (e.ctrlKey && e.key === 'U')) {
                e.preventDefault();
            }
        });

        processRedirect();
    })();
</script>
</body>
</html>
